package com.frxuexi.base.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.frxuexi.base.entity.UserBean

@Dao
interface UserDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun register(userBean: UserBean):Long

    @Query("select * from user where uName=:uname and uPwd=:upass")
    fun login(uname:String,upass:Int):UserBean

    @Update
    fun updateToken(userBean: UserBean):Int

    @Delete
    fun deleteUser(userBean: UserBean)

}